package com.example.xiaoshou.service.impl;
 

import com.alibaba.fastjson.JSONObject;
import com.example.xiaoshou.service.KuCunService;
import com.example.xiaoshou.service.OrderService;
import com.example.xiaoshou.service.TestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Slf4j
@Service
public class TestServiceImpl implements TestService {
 
 
    @Autowired
    private KuCunService kuCunService;
    @Autowired
    private OrderService orderService;
 
    /**
     *
     * @param
     * @return
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void test() {
        //调用库存服务
        kuCunService.update();
        System.out.println("调用库存服务成功");
        //调用订单服务
        orderService.addOrder();
        System.out.println("调用订单服务成功");
        System.out.println("处理完毕");
    }



}